//
import request from '@/utils/request'
export function getDepartments() {
  return request({
    url: '/company/department',
    method: 'get'
  })
}
// 发送新增数据
export function addDepartments(data) {
  return request({
    url: '/company/department',
    method: 'post',
    data
  })
}

// 删除数据
export function delDepartments(id) {
  return request({
    url: `/company/department/${id}`,
    method: 'delete'

  })
}

// 获取当前部门数据（点击编辑的时候显示出来）
export function getDepartmentsByid(id) {
  return request({
    url: `/company/department/${id}`,
    method: 'get'

  })
}

// 上传编辑了的部门数据（点击提交显示出来）
export function updateDepartment(data) {
  return request({
    url: `/company/department/${data.id}`,
    method: 'put',
    data
  })
}

